/*
** ADOBE SYSTEMS INCORPORATED
** Copyright 2012 Adobe Systems Incorporated
** All Rights Reserved.
**
** NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the
** terms of the Adobe license agreement accompanying it.  If you have received this file from a
** source other than Adobe, then your use, modification, or distribution of it requires the prior
** written permission of Adobe.
*/

#pragma once
#include <vector>
#include <Flash++.h>

#include <Actor.h>

using namespace std;
using namespace AS3::ui;

namespace SpaceTriangle
{
	class Ship;
	class Missile;
	
	class Game
	{
		friend class Ship;
		friend class Missile;
		friend class Asteroid;

		flash::display3D::Context3D ctx3d;
		flash::display::Stage3D s3d;
		flash::display::Stage stage;

		vector<Actor*> actors;

		Ship *player;

		float width,height;

	public:
		Game();

		void tick();

		void render(flash::display3D::Context3D _ctx3d);

		void init(flash::display::Stage _stage, flash::display::Stage3D _s3d);

		void handleKeyUp(int keyCode);
		void handleKeyDown(int keyCode);

		void spawnMissile(vec3 pos, vec3 speed, float rads);
		void spawnAsteroid(vec3 pos, vec3 speed);
	};
}